package cn.edu.xjtu.competiton.Acwing.AcWingCup1.second;

import java.util.Deque;
import java.util.LinkedList;
import java.util.Scanner;

/**
 * https://www.acwing.com/problem/content/4380/
 */
public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for (int i = 0; i < T; i++) {
            int n = sc.nextInt();
            int k = sc.nextInt();
            int ans = 0;
            int[] farm = new int[n];
            Deque<Node> deque = new LinkedList<>();

            for (int j = 0; j < k; j++) {
                int index = sc.nextInt() - 1;
                farm[index] = 1;
                deque.addFirst(new Node(index, 0));
            }

            while (!deque.isEmpty()) {
                ans++;
                int size = deque.size();
                while (size > 0) {
                    Node node = deque.removeLast();
                    int index = node.index;
                    if (node.direction == -1 || node.direction == 0) {
                        // 向左
                        if (index > 0 && farm[index - 1] == 0) {
                            deque.addFirst(new Node(index - 1, -1));
                            farm[index - 1] = 1;
                        }
                    }
                    if (node.direction == 1 || node.direction == 0) {
                        // 向右
                        if (index < farm.length - 1 && farm[index + 1] == 0) {
                            deque.addFirst(new Node(index + 1, 1));
                            farm[index + 1] = 1;
                        }
                    }
                    size--;
                }
            }
            System.out.println(ans);
        }

    }
}

class Node {
    int index;// 行
    int direction;// 列

    public Node(int index, int direction) {
        this.index = index;
        this.direction = direction;
    }
}